use std::io;

use dalton_lib::chem_parse;

fn main() {
    println!("input a chemical:");

    let mut chemical = String::new();
    io::stdin()
        .read_line(&mut chemical)
        .expect("cannot read anything");
    let chemical = chemical.trim();

    match chem_parse(chemical) {
        Ok(dalton) => println!("Mr({}): {}", chemical, dalton),
        Err(e) => eprintln!("Err: {}", e),
    }
}
